<template>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  <el-form-item label="教师id" prop="Tid">
    <el-input v-model="ruleForm.Tid"></el-input>
  </el-form-item>
   <el-form-item label="教师姓名" prop="Tname">
    <el-input v-model="ruleForm.Tname"></el-input>
  </el-form-item>
  </el-form-item>
   <el-form-item label="设置密码" prop="Tpwd">
    <el-input v-model="ruleForm.Tpwd"></el-input>
  </el-form-item>
  <el-input placeholder="请输入密码" v-model="input" show-password></el-input>

  <el-row>
  <el-button>注册</el-button>
  <el-button plain>清空</el-button>
  <el-button round>退出</el-button>
</el-row>

<el-row>
  <el-button icon="el-icon-search" circle></el-button>
</el-row>
  
</el-form>


<script>
  export default {
    data() {
      return {
        ruleForm: {
          Tid: '',
          Tname: '',
        },
        rules: {
          Tid: [
            { required: true, message: '请输入教师id', trigger: 'blur' },
            { min: 1, max: 10, message: '最长为10个字符', trigger: 'blur' }
          ],
           Tname: [
            { required: true, message: '请输入教师姓名', trigger: 'blur' },
            { min: 1, max: 10, message: '最长为10个字符', trigger: 'blur' }
          ],
          Tpwd: [
            { required: true, message: '请输入密码', trigger: 'blur' },
            { min: 1, max: 10, message: '最长为10个字符', trigger: 'blur' }
          ]
        }
      };
    }

    export default {
    data() {
      return {
        input: ''
      }
    }
  }

    methods: {
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      }
    }
  }
</script>